package yki.paperplane.server;

import java.io.IOException;
import java.sql.Date;
import java.sql.Time;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class HelloPageServlet
 */
@WebServlet("/HelloPageServlet")
public class HelloPageServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public HelloPageServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    @Override
    protected void service( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException{
		super.service(request, response);
		
	}
    
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		Date date = new Date( System.currentTimeMillis() );
		Time time = new Time( System.currentTimeMillis() );
		response.getWriter().println("Hello, this is PaperPlaneServer" + date.toString() + " " + time.toString());
		response.getWriter().close();
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
